<template>
    <div :style="themeStyle">
        <p>{{ ChildrenMessage }}</p>
    </div>
</template>
<script setup>
import { computed, inject, onBeforeUnmount, onUnmounted } from "vue";
const ChildrenMessage='我是子组件'

const theme=inject('tKey',{
    color:'red',
    fontSize:'20px'
})
const themeStyle=computed(()=>({
    color:theme.color,
    fontsize:theme.fontSize
}))


</script>